class Request {
	constructor(baseURL) {
		this.baseURL = baseURL
	}
	request(options) {
		const {
			url
		} = options
		return new Promise((resolve, reject) => {
			wx.request({
				...options,
				url: this.baseURL + url,
				success: (res) => {
					resolve(res.data)
				},
				fail: (err) => {
					console.log("err:", err);
				}
			})
		})
	}
	get(options) {
		return this.request({
			...options,
			method: "get"
		})
	}
	post(options) {
		return this.request({
			...options,
			method: "post"
		})
	}
}


export const loginRequest = new Request("http://192.168.12.169:8080/auth")

// export const loginRequest = new Request("http://127.0.0.1:8080/auth")
// export const loginRequest = new Request("http://192.168.31.38:8080/auth")
// export const loginRequest = new Request("http://10.173.225.198:8080/auth")